<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title>FreeMarker</title>
    <link rel="stylesheet" href="/static/js/layui/css/layui.css">
</head>
<body>
<div class="layui-container">
    <div class="layui-row">
        <@studentList name="王" pageNumber="1" pageSize="10">
            <#if page??>
                <div class="layui-col-md12">
                    总条数:   <span class="layui-badge">${ page.content?size }</span> ,
                    排序方式: <span class="layui-badge layui-bg-green"> ${ page.pageable.sort }</span>
                </div>
                <div class="layui-col-md12">

                    <table class="layui-table">
                        <colgroup>
                            <col width="150">
                            <col width="200">
                            <col width="200">
                            <col width="200">
                            <col width="400">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>姓名</th>
                            <th>年龄</th>
                            <th>性别</th>
                            <th>班级</th>
                            <th>分数</th>
                        </tr>
                        </thead>
                        <tbody>
                        <#list page.content as stu>
                            <tr>
                                <td>${stu.name}</td>
                                <td>${stu.age}</td>
                                <td>
                                    <#if stu.gender == 1>男</#if>
                                    <#if stu.gender == 2>女</#if>
                                </td>
                                <td>
                                    ${stu.classes.name}
                                </td>
                                <td>
                                    <#if stu.scoreList??>
                                        <#list stu.scoreList as sc>
                                            ${sc.course.name}:${sc.score} /
                                        </#list>
                                    </#if>
                                </td>
                            </tr>
                        </#list>

                        </tbody>
                    </table>
                </div>
            </#if>
        </@studentList>
    </div>
</div>
<script src="/static/js/jquery-3.4.1.js"></script>
<script src="/static/js/layui/layui.js"></script>
</body>
</html>